package com.uubx.controller;

import com.uubx.pojo.Employee;
import com.uubx.result.Result;
import com.uubx.result.ResultUtils;
import com.uubx.service.EmployeeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author wyy
 * @Date 2020/12/25 23:53
 * @Version 1.0
 */
@Controller
@ResponseBody
@RequestMapping("/em")
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    @RequestMapping(value = "/find",method = RequestMethod.GET)
    @ApiOperation(value = "根据id查询用户的接口",notes = "根据id查询用户的接口",httpMethod = "GET")
    public Result find(Long id){
        Employee employeeById = employeeService.findEmployeeById(id);

       return ResultUtils.buildSuccess(employeeById);
    }



}
